package cn.iocoder.yudao.module.dify.config;

import io.github.imfangs.dify.client.DifyChatClient;
import io.github.imfangs.dify.client.DifyClientFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DifyChatConfig {

    @Value("${spring.dify.baseUrl}")
    private String difyUrl;

    @Value("${spring.dify.key.chat-robot}")
    private String difyKey;

    @Bean
    public DifyChatClient difyChatClient() {
        return DifyClientFactory.createChatClient(difyUrl, difyKey);
    }
}

